<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    .box{
        width: 1080px;
        height: 300px;
        background-color: skyblue;
        margin: 0 auto;
    }
</style>
<body>
    <div class="box">我是广告
        <button id="btn">倒计时(5s)</button>
    </div>

    <script>
        const box = document.querySelector('.box')
        const btn = document.querySelector('#btn')

        setTimeout(function(){
            box.style.display = 'none';
        },5000);
        let second = 5;
    let time = setInterval(()=>{
        second --;
        btn.innerHTML = `倒计时(${second})`;
        if (second === 0 ){
            clearInterval(time);
            // btn.innerHTML = '好';
            btn.disabled = false;
        }
    },1000);
    </script>
</body>
</html>